<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
  	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>OpenPanel beta</title>
	<link rel="stylesheet" type="text/css"	href="css/openpanel.css">
	<link rel="stylesheet" type="text/css"	href="css/forms.css">
	<link rel="stylesheet" type="text/css"	href="css/dropdown.css">
	<link rel="stylesheet" type="text/css"	href="css/gridview.css">
	<link rel="stylesheet" type="text/css"	href="css/welcome.css">
	<!--[if gte IE 7]>
	<link rel="stylesheet" type="text/css"	href="css/openpanel.ie7.css">
	<![endif]-->
	<script type="text/javascript">
		var bgimage = new Image(32,32);
		bgimage.src = "/images/gui/loadingbackground.png";
		var crowimage = new Image(32,32);
		crowimage.src = "/images/gui/crow.png";
		var spinner = new Image(32,32);
		spinner.src = "/images/gui/prespinner.gif";
	</script>
	<script type="text/javascript" src="js/prototype-1.6.0.3.js"></script>
	<script type="text/javascript" src="js/preloader.js"></script>
	<script type="text/javascript" src="js/BrowserDetect.js"></script>
	<script type="text/javascript" src="js/OpenCore/OpenCore.js"></script>
	<script type="text/javascript" src="js/OpenCore/RPC.js"></script>
	<script type="text/javascript" src="js/OpenCore/DataManager/DataManager.js"></script>
	<script type="text/javascript" src="js/OpenCore/DataManager/OpenCoreObject.js"></script>
	<script type="text/javascript" src="js/OpenCore/Debug.js"></script>
	<script type="text/javascript" src="js/OpenPanel/OpenPanel.js"></script>
	<script type="text/javascript" src="js/OpenPanel/KeyboardHandler.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Controller.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/Command.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/Init.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/DeleteInstance.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/ShowCreateInstanceFromItemList.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/ShowCreateInstanceFromFormObject.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/ShowCreateInstanceFromFormObjectMeta.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/CreateInstanceFromFormObject.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/CreateInstanceFromItemList.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/ShowDeleteInstanceFromFormObject.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/DeleteInstanceFromFormObject.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/SaveForm.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/SaveFormDone.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/Login.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/Logout.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/Welcome.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/BuildIconBar.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/ClickIconBarItem.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/ClickItemListItem.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/ClickTabBarItem.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/ClickGridItem.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/InvokeMethod.js"></script>
	<script type="text/javascript" src="js/OpenPanel/Command/LoadTemplateIntoPopup.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/GUIBuilder.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/Throbber.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/Form.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/OpenCoreObjectForm.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/FormElement/FormElement.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/FormElement/Base.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/FormElement/Bool.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/FormElement/Textarea.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/FormElement/Enum.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/FormElement/Hidden.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/FormElement/IPAddress.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/FormElement/String.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/FormElement/Integer.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/FormElement/Password.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/FormElement/Reference.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/FormRenderer.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/SingleColumnFormRenderer.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/GUIElements/GUIElements.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/GUIElements/DropDownMenu.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/GUIElements/Grid.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/GUIElements/IconBar.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/GUIElements/ItemList.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/GUIElements/TabBar.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/GUIElements/FormBuilder.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/GUIElements/FormFields.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/GUIElements/FormGrid.js"></script>
	<script type="text/javascript" src="js/OpenPanel/GUIBuilder/GUIElements/FormObject.js"></script>
	
	<script type="text/javascript">
		if(typeof(console) != "object") {
			console = { log: function(){} }
		}
	</script>
  	</head>
	<body onload="init()">
		<div id="mainAreaLeft">&nbsp;</div>
	
		<div id="loaderDiv">
			<div id="prespinnerDiv"><img src="/images/gui/prespinner.gif"></div>
		</div>
		<div id="modalMessageDiv">
			<div id="modalMessageDivTop"></div>
			<div id="modalMessageContent"></div>
			<div id="modalMessageDivBottom"></div>
		</div>
		<div id="app" class="activeBrowserWindow"></div>
		<div id="modal"></div>
	    <div id="modalLoadingDiv" class="modalLoadingDivLogin"></div>
	    <input id="tabCycleCatcher" style="position:absolute; right:0px; bottom:0px; width: 0px; height: 0px; opacity: 1.0;"
	    	   onfocus="recycleFocus();" tabindex="65535">
	    <script type="text/javascript">
			preloadImages();
			
			function init() {
				
				///var scrollbar = new Control.ScrollBar('scrollbar_content','scrollbar_track');
				//scrollbar.recalculateLayout();  
				document.body.style.backgroundImage = "url(/images/gui/sky.jpg)";
				document.getElementById("loaderDiv").style.visibility = "hidden";
				document.getElementById("app").style.visibility = "visible";
				
				OpenCore.RPC.RequestHandler.setOpenCoreURL("/fake-opencore-proxy/json");
				
				OpenCore.DataManager.setRPC(OpenCore.RPC);
				OpenPanel.Controller.setDataManager(OpenCore.DataManager);
				
				OpenPanel.Controller.setGuiBuilder(OpenPanel.GUIBuilder);
				OpenPanel.GUIBuilder.GUIElements.ItemList.setGuiBuilder(OpenPanel.GUIBuilder);
				OpenPanel.GUIBuilder.GUIElements.ItemList.setController(OpenPanel.Controller);
				OpenPanel.GUIBuilder.GUIElements.FormObject.setGuiBuilder(OpenPanel.GUIBuilder);
				OpenCore.RPC.RequestHandler.startLoading = OpenPanel.GUIBuilder.showLoadingDiv;
				OpenCore.RPC.RequestHandler.doneLoading = OpenPanel.GUIBuilder.hideLoadingDiv;
				
				OpenPanel.Controller.action( 
				{
					command: "Init" , userName: "openadmin", password: "foobar" 
				});
				
			}
			
			window.onblur = function() {
				document.getElementById("app").className = "inactiveBrowserWindow";
			}
			
			window.onfocus = function() {
				document.getElementById("app").className = "activeBrowserWindow";
			}
			
			function recycleFocus() {
				var first = jQuery("input")[0];
				if (first == undefined) return;
				if (first.id == "tabCycleCatcher") return;
				first.focus();
			}
	    </script>
		</body>
</html>
